<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>合同回寄</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/product.css">
	<link rel="stylesheet" href="css/select-big.css">
	<link rel="stylesheet" href = "css/fuzzy-query.css">
	<style>
		.content-btn {
		    margin: 0 16px;
		}
		.product-child-content{
			width: 970px;
			margin: 0 auto;
		}
		.product-child-content .content-btn {
		    margin: 0;
		}
		.content-table-two tbody tr td input{
			width: 80%;
			height: 30px;
			line-height: 30px;
			background: #F9FBFF;
			border: 1px solid #ecf2f7;
			border-radius: 15px;
			text-align: center;
		}
		.icon-delImg{
			display: inline-block;
		    background: url(images/close-1.png)no-repeat;
		    width: 25px;
		    height: 25px;
		    cursor: pointer;
		}
		.icon-delImg:hover{
			background: url(images/close-1.png)no-repeat 0 -27px;
		}
	</style>
</head>
<body>
<div class="main-content">
	<form dataHref = "/expressInformation/saveReturn">
		<input type = "hidden" value = "1" name = "type" />
		<input type = "hidden" value = "" name = "addressee" />
		<div class="main-bg1">
			<div class="content-btn bot-line">
				<a class="icon-back" href="contractDistribution.html"></a><span class="title-info-a">合同回寄</span>
			</div>
			<div class="content-list">
				<table class="content-table-newservice" cellspacing="0" cellpadding="0">
					<tbody>
						<tr>
							<td><span class="info-red"><font color="red">*</font>快递公司：</span></td>
							<td><select id="single2" name = "company">
								<option value="1">顺丰快递</option>
								<option value="2">圆通快递</option>
								<option value="3">申通快递</option>
								<option value="4">韵达快递</option>
								<option value="5">汇通快递</option>
								<option value="6">邮政EMS</option>
								<option value="7">自取</option>
							</select></td>
						</tr>
						<tr>
							<td><span class="info-red"><font color="red">*</font>快递单号：</span></td>
							<td><input type="text" name = "tracknumber" class = "required"></td>
						</tr>
						<tr>
							<td>描述：</td>
							<td><textarea name="" id="" cols="30" rows="3" name = "remark"></textarea></td>
						</tr>
					</tbody>
				</table>
			</div>
			<div class="product-child-content">
				<div class="content-info">
					<div class="content-btn bot-line">
						<span class="title-info">纸质合同信息</span>
					</div>
					<table class="tableOrder content-table-two matop" cellspacing="0" cellpadding="0" id = "table" >
						<tbody style = "display:none;">
							<th title = "项目编号" name = "projectcode" type = "string"></th>
							<th title = "项目名称" name = "projectname" type = "string"></th>
							<th title = "部门名称" name = "department" type = "string"></th>
							<th title = "客户编号" name = "custcode" type = "string"></th>
							<th title = "客户名称" name = "custname" type = "string"></th>
							<th title = "倒账金额" name = "appoint.transfercash" type = "string"></th>
							<th title = "纸质合同编号" name = "" type = "string"></th>
							<th title = "理顾姓名" name = "isname" type = "string"></th>
							<th title = "分发时间" name = "issuedate" type = "string"></th>
						</tbody>
					</table>
				</div>
				<button class="save-btn matop">保存</button>
			</div>
		</div>
	</form>
</div>
	<script src="js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
	<script src="js/select.jquery.js"></script>
	<script type="text/javascript" src = "js/util.js"></script>
	<script type="text/javascript" src = "js/allProduct.js"></script>
	<script>
    	function del(my){
    		$(my).parent().parent().remove();
    	}
    	$(document).ready(function(){
    		var data = parent.data;
    		$("input[name='addressee']").val(data.addressee);
    		$("#table").ECDATable(data);
    	})
    	function validateCallback(){
    		var $table = $("#table");
    		var $tr = $table.find("thead").find("tr");
    		var length = $tr.length;
    		if(length < 1){
    			parent.layer.msg("无合同需要回寄");
    			return false;
    		}
    		for(var i = 0 ; i < length ; i++){
    			if(!$($tr[i]).find(".contract").val()){
    				parent.layer.msg("合同编号不能为空");
    				return false;
    			}
    		}
    		return true;
    	} 
    	function submitCallback(){
    		parent.layer.msg("成功回寄");
    		parent.goUrl("return.html");
    	}
    	function dl(my){
    		var $this = $(my);
    		$this.parent().parent().remove();
    	}
    	function tableCallBack(my){
    		my.find("thead").find("tr").append("<td>操作</td>");
    		console.log(parent.data);
    		var $tr = my.find("tbody").eq(1).find("tr");
    		for(var i = 0 ; i < $tr.length ; i ++){
    			var $this = $($tr[i]);
    			$this.find("td").eq(6).append("<input type = 'text' class = 'contractcode' name = 'details[" + i + "].contractcode' >").append("<input type = 'hidden' name = 'details[" + i + "].id' value = '" + parent.data[i].id + "'>");
    			$this.append("<td><i class = \"btn-operation\" onclick = \"dl(this)\">删除</i></td>");
    		}
    	}
        function getHeight(){
            var myiframeH=$(".main-content").height();
            var _parent=$(window.parent.document);
            _parent.find('body').css('height',(myiframeH+150)+'px');
            _parent.find('.main-position').css('height',(myiframeH+100)+'px');
        };
        $('.main-content').resize(function(){
            getHeight();
        });
	</script>
	<script src="js/jquery-validation/1.11.0/jquery.validate.min.js" type="text/javascript"></script>
	<script type="text/javascript" src = "js/table.js"></script>
	<script type="text/javascript" src = "js/submit.js"></script>
	<script type="text/javascript" src = "js/validate.js"></script>
</body>
</html>